package kr.saeildamil.androidstudy.ch13;

import kr.saeildamil.androiddforstudy.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.Switch;
import android.widget.Toast;

public class SwitchTest extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_switchtest);

		Switch sw = (Switch) findViewById(R.id.ch13_switch01);
		sw.setOnCheckedChangeListener(new OnCheckedChangeListener() {

			@Override
			public void onCheckedChanged(CompoundButton buttonView,
					boolean isChecked) {
				Toast.makeText(SwitchTest.this, "체크 상태 : " + isChecked, Toast.LENGTH_SHORT).show();
			}
		});
	}
}
